package Algorithm;

public class LC557 {
    public String reverseWords(String s) {
        String[] str=s.split(" ");
        for(int i=0;i<str.length;i++){
            StringBuilder sb=new StringBuilder(str[i]);
            str[i]=sb.reverse().toString();
        }
        StringBuilder sb2=new StringBuilder();
        for(int i=0;i<str.length;i++){
            sb2.append(str[i]+" ");
        }
        return sb2.toString().trim();
    }
}
